import {defineStore} from "pinia";
//store定义风格2：Option Store
//vue 方法搞得像对像，对象搞得像方法。怪。。
export const useCounterStore = defineStore("counter", {
    state: () => {
        return {
            count: 0,
        }
    },
    getters: {
        double(state) {
            return state.count * 2;
        },
    },
    actions: {
        increment() {
            this.count += 1
        }
    },

    // state:()=>({
    //     count:0,
    // }),
})